Skip to content

Conversation

ln-12
Copy link
Contributor

@ln-12 ln-12 commented Aug 29, 2025

This PR adds a UI section inside the tools tab which enabled the user to provide extra key-value pairs for the _meta object. Fixes #559.

UI:
image

Request:
image

Motivation and Context

Currently there is no way to provide additional _meta values in the UI.

How Has This Been Tested?

I provided values in the UI and checked that they are sent in the request. Also, I added a test.

Breaking Changes

No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@ln-12
Copy link
Contributor Author

ln-12 commented Oct 2, 2025

I also added another section to the main UI so that it is possible to add meta data for all calls (like initialize, tools/list, ...):

image

Copy link
Member

@cliffhall cliffhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this!

Tested locally with prompts/list resources/list, resources/subscribe, resources/unsubscribe, resources/templates/list, completion/complete, resources/read, tools/call, and tools/list.

However,

Image

Can we just make this "Metadata"? I understand it's "data for the _meta param" but Metadata is a word. Meta Data is weird.

And make MetaDataTab be MetadataTab.

toolMeta?: Record<string, string>;
transport?: "sse" | "stdio" | "http";
headers?: Record<string, string>;
metaData?: Record<string, string>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for metaData I can see it has been threaded through all the calls, but there are no tests. Can you add cli tests for the calls that pass something in metaData?

)}
<div className="pb-4">
<div className="flex items-center justify-between mb-2">
<h4 className="text-sm font-semibold">Meta:</h4>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should say "Tool-specific Metadata:" to disambiguate between these pairs and those entered on the Metadata tab

<div className="bg-gray-50 dark:bg-gray-900 p-3 rounded-lg">
<div className="flex items-center justify-between mb-2">
<h4 className="text-sm font-semibold">Meta:</h4>
<h4 className="text-sm font-semibold">Meta Schema:</h4>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this label. When _meta is attached to a tool, it isn't necessarily a "schema". The only thing the protocol says is:

The _meta property/parameter is reserved by MCP to allow clients and servers to attach additional metadata to their interactions.

The tool has an inputSchema if it needs you to send specific values to it in the tool call. This seems like you are indicating that this is a schema for what the client should send in the _meta field of a tool call.

Is there consensus on this usage somewhere that supports this labeling?

</TabsTrigger>
<TabsTrigger value="metadata">
<Settings className="w-4 h-4 mr-2" />
Meta Data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Meta Data
Metadata

{structuredResult._meta && (
<div className="mb-4">
<h5 className="font-semibold mb-2 text-sm">Meta:</h5>
<h5 className="font-semibold mb-2 text-sm">Meta Schema:</h5>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a thing as far as I can tell. The spec only says

The _meta property/parameter is reserved by MCP to allow clients and servers to attach additional metadata to their interactions.

If there is consensus or examples somewhere that you can point to of the tool _meta being interpreted as a schema, please note.

Otherwise, there is the inputSchema that tools use to specify what they'd like the client to send in when invoking it.

@cliffhall cliffhall added the waiting on submitter Waiting for the submitter to provide more info label Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting on submitter Waiting for the submitter to provide more info

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for the _meta in MCP inputs and outputs

3 participants